﻿
namespace MyFurion.Model
{
    /// <summary>
    /// 用户信息
    /// </summary>
    [SugarTable("Sys_User")]
    [Tenant(0)]
    public class UserInfo:BaseEntity
    {
        /// <summary>
        /// 用户姓名
        /// </summary>
        [SugarColumn(IsNullable =true,ColumnDescription = "用户姓名")]
        public string UserName { get; set; }
        /// <summary>
        /// 用户昵称
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "用户昵称")]
        public string NickName { get; set; }
        /// <summary>
        /// 登录账户
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "登录账户")]
        public string Account { get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnDescription = "登录密码")]
        public string LoginPwd { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "联系电话")]
        public string Tel { get; set; }
        /// <summary>
        /// 电子邮箱
        /// </summary>
        [SugarColumn(IsNullable = true, ColumnDescription = "电子邮箱")]
        public string Email { get; set; }
        /// <summary>
        /// 是否超级管理员
        /// </summary>
        [SugarColumn(ColumnDescription = "是否超级管理员", DefaultValue = "0")]
        public bool IsSuperAdmin { get; set; }
        /// <summary>
        /// 停用启用状态
        /// </summary>
        [SugarColumn(ColumnDescription = "停用启用状态：0停用 1启用", DefaultValue = "1")]
        public EnumStatus Status { get; set; }
        /// <summary>
        /// 组织机构id
        /// </summary>
        [SugarColumn(ColumnDescription = "组织机构id",DefaultValue ="0")]
        public long OrgId { get; set; }
        /// <summary>
        /// 组织机构信息
        /// </summary>
        [Navigate(NavigateType.OneToOne, nameof(OrgId))]
        public OrgInfo OrgData { get; set; }
        /// <summary>
        /// 关联角色id集合
        /// </summary>
        [SugarColumn(IsIgnore = true)]
        public List<long> RoleIds { get; set; } = new();
    }
}
